/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.made2ordersoftware.drinkmaker.control;

import com.made2ordersoftware.drinkmaker.business.DrinkMgr;
import com.made2ordersoftware.drinkmaker.domain.enums.GlassType;
import com.made2ordersoftware.exceptions.DAOException;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.EntityExistsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author David
 */
@Named(value = "drinkCtrl")
@Dependent
public class DrinkCtrl {

    private static final Logger LOG = LoggerFactory.getLogger(DrinkCtrl.class);
    @Inject
    private DrinkMgr manager;
    private String drinkName;
    private String instructions;
    private GlassType glass;
    private String image;
    private String ingredient1;
    private String ingredient2;
    private String ingredient3;
    private String ingredient4;
    private String ingredient5;
    private String amount1;
    private String amount2;
    private String amount3;
    private String amount4;
    private String amount5;

    /**
     * Creates a new instance of DrinkCtrl
     */
    public DrinkCtrl() {
    }

    /**
     *
     */
    public void createDrink() {
        try {
            manager.addDrink(getDrinkName(), getInstructions(), getGlass(), getImage(), getIngredient1(),
                    getIngredient2(), getIngredient3(), getIngredient4(), getIngredient5(), getAmount1(),
                    getAmount2(), getAmount3(), getAmount4(), getAmount5());
        } catch (EntityExistsException e) {
            e.printStackTrace();
        } catch (DAOException e) {
            e.printStackTrace();
        }
    }

    /**
     *
     */
    public void searchByDrink() {

    }

    /**
     *
     */
    public void searchByIngredient() {

    }

    // <editor-fold defaultstate="collapsed" desc="getters-setters">
    /**
     * @return the drinkName
     */
    public String getDrinkName() {
        return drinkName;
    }

    /**
     * @param drinkName the drinkName to set
     */
    public void setDrinkName(String drinkName) {
        this.drinkName = drinkName;
    }

    /**
     * @return the instructions
     */
    public String getInstructions() {
        return instructions;
    }

    /**
     * @param instructions the instructions to set
     */
    public void setInstructions(String instructions) {
        this.instructions = instructions;
    }

    /**
     * @return the glass
     */
    public GlassType getGlass() {
        return glass;
    }

    /**
     * @param glass the glass to set
     */
    public void setGlass(GlassType glass) {
        this.glass = glass;
    }

    /**
     * @return the image
     */
    public String getImage() {
        return image;
    }

    /**
     * @param image the image to set
     */
    public void setImage(String image) {
        this.image = image;
    }

    /**
     * @return the ingredient1
     */
    public String getIngredient1() {
        return ingredient1;
    }

    /**
     * @param ingredient1 the ingredient1 to set
     */
    public void setIngredient1(String ingredient1) {
        this.ingredient1 = ingredient1;
    }

    /**
     * @return the ingredient2
     */
    public String getIngredient2() {
        return ingredient2;
    }

    /**
     * @param ingredient2 the ingredient2 to set
     */
    public void setIngredient2(String ingredient2) {
        this.ingredient2 = ingredient2;
    }

    /**
     * @return the ingredient3
     */
    public String getIngredient3() {
        return ingredient3;
    }

    /**
     * @param ingredient3 the ingredient3 to set
     */
    public void setIngredient3(String ingredient3) {
        this.ingredient3 = ingredient3;
    }

    /**
     * @return the ingredient4
     */
    public String getIngredient4() {
        return ingredient4;
    }

    /**
     * @param ingredient4 the ingredient4 to set
     */
    public void setIngredient4(String ingredient4) {
        this.ingredient4 = ingredient4;
    }

    /**
     * @return the ingredient5
     */
    public String getIngredient5() {
        return ingredient5;
    }

    /**
     * @param ingredient5 the ingredient5 to set
     */
    public void setIngredient5(String ingredient5) {
        this.ingredient5 = ingredient5;
    }

    /**
     * @return the amount1
     */
    public String getAmount1() {
        return amount1;
    }

    /**
     * @param amount1 the amount1 to set
     */
    public void setAmount1(String amount1) {
        this.amount1 = amount1;
    }

    /**
     * @return the amount2
     */
    public String getAmount2() {
        return amount2;
    }

    /**
     * @param amount2 the amount2 to set
     */
    public void setAmount2(String amount2) {
        this.amount2 = amount2;
    }

    /**
     * @return the amount3
     */
    public String getAmount3() {
        return amount3;
    }

    /**
     * @param amount3 the amount3 to set
     */
    public void setAmount3(String amount3) {
        this.amount3 = amount3;
    }

    /**
     * @return the amount4
     */
    public String getAmount4() {
        return amount4;
    }

    /**
     * @param amount4 the amount4 to set
     */
    public void setAmount4(String amount4) {
        this.amount4 = amount4;
    }

    /**
     * @return the amount5
     */
    public String getAmount5() {
        return amount5;
    }

    /**
     * @param amount5 the amount5 to set
     */
    public void setAmount5(String amount5) {
        this.amount5 = amount5;
    }
    // </editor-fold>

}
